Refactor to handle branches and boundary events on user task.