processhamdler refactor