Reduce length of compare method