refactor comparable