start of major refactoring/reorganization