Centralize more task-initialization code.