workng through a major refactoring
continuing refactor