Proper equality handling; shared code moved to Base