More cleanup of bad code