Updated key_terms_helper to include type and id