holy refactoring batman