Refactor Compare Method