various refactoring changes, will be restarting design with a different structure