Use better api methods

setContents() and runTask()