Some cleanup and reorganization of stuff