[processing] some refactoring as suggested by Nathan Woodrow