refactoring proc