a trivial refactoring for dynatree