Changed method of getting tasks so that config can be passed in.