refactoring into modules