major refactor/reorg of classes and clean up