more reorganization and cleanup