Re-factored so that blocking operations can be managed. Caching is also provided for resource retrieval.