In fact you could make the whole *run* function be a task, which would not only make the code more readable, it would mean you wouldn't have to break it into two separate *run* and *doRun* functions.