Comparison for equality was heavily duplicated.

It's really bad practice to duplicate code that uses general cases comparison where some very narrow case is required - logic is duplicated which is very bad for maintenance.