Refactor retrieval tasks