Before refactoring, working