created a resource retriever
cleaned up main