partway through refactoring