Refactor spaceship comparison