Simplified processTasks and callFunction.