cleanup for the ray class