Unify handling of the task method