Refactored the code; so beautiful I want to pour a glass of whisky, put on some light German electronica and weep