Refactoring according to architecture
refactoring part 2