Changing code so that it uses the Object instead of the entity class.