Refactor: Changing string comparison to numeric comparison when it was
needed