refactor processor definition