little bit of refactoring (sort of).