Refactor retriever to parser