refactoring and update to design
refactoring