Ugly switch case replaced with Enum and one loop. Code inspections runned.