Introducing optimizations and MemoryCache to avoid always hitting DB.