refactoring phase