refactor to combine insert/update data into getEntityData()