initial modular refactoring