Refactor comparison into spaceship operator