refactoring for design