Reorganization and tests