code design refactoring