Update range-v3 and refactor some stuff