Refactor compare to make it more clear