(sort of) refactoring