pre-refactoring solution