refactoring to use more modules