refactoring and added integration tests
refactoring of modules