Improved caching. Lookup time based on Id reduced from N to Log N.