refactoring some more...