Some cleanup wrt what code goes in which file.