Refactoring code process