Simplify and optimize cache tree.