refactor makeComparison and use it in more places