Cleaned up, removed a bunch of stuff that we are not using. Also attempt at caching.