rewrite task fetching - fixes #3 fixes #4