Major refactoring, and added a cache interceptor