some improvements to the refraction class