Refactored __eq__ to be more readable