reorganization and clean up