maybe use `switch ($entity_type) { case: 'node': ... case: 'taxonomy_term' }` for clarity?