Refactor some fragment caching