Updated with Ruf's cleanup rules