Refactor comparison