clean up shadow code