Added caching for layouts