reorganization and refactoring