halfway through the refactoring