Improved method for the precise determination of the compressibility factor from refractive index measurements