Refactor previous version of hierarchical_pets with structured taxonomy