holy refactor batman