Minor refactoring move_ray method