Optimize ranges a bit