Made layout caching be more compact by keeping references to the original content where easy