Refactored the comparison display method to remove redundant code.