major refactor
continued refactoring