if-else instead of switch