refactoring design