optimize refraction