moar refactoring
continued refactoring