improve validators in input range and refactor code in validators