Cleaned if else by switch case