Refactoring proc