reorganization and cleanup