Move buffer-init code into Task.