small refactor to apply DRY on Comparable class