Refactoring phase