cake: improved speed and accuracy of ray refinement