refactored process