refactor taxonomy tree to use a function

Fixes #2622
We are switching to using TeamCity for our CI server