refactor out taxonomy label generation method for reuse in external code