Remove disabled code and a little cleanup