tinkered with refactoring some more