Raytracer refractoring