more refactoring to separate modules from each other