more gross refactoring