clean up bad code