another cool refactoring