refactor large if-elif block