Split code so we can reuse it without copying it.