cleanup
overhaul: refactored large if-elif block into dictionary