Move getIntRange to a visitor class