rewrite catetree_abstract which detect whether a array or not before build catetree structure