translator: changed process internal functions to throw errors

restructured function a bit, removed several local variables
removed return value from function
added expression error status helper function