Ranges common pattern optimization