Doing the actual value comparisons; code refactoring