Updated "retrieve_attributes_for_entity" for new attribute layout.