more goddamn refactoring