refactoring main design
refactoring design