Cleans up the 'equals' code