handler function has much cleaner switch instead of if else. Broke handler into component pieces