Refactoring and redesign