major reorganization and cleanup