Refactor taxonomy js tree as mentioned in #2129