moved switch statement for handling EM engine tiles to separate function