remove duplicated view code from leafs