refactored hasChanges method of Product