optimize view hierarchy