[refactor] Move getIntRange to a visitor class