last bit of refactoring