modulize refactoring