Apply 2st phase of refactoring