simplify & comment range-traverse function