Shadows optimization, cache clearing while theme changing