halfway through refactoring