Reorganization and refactoring