simplify tree editor js a bit