modular refactor