Stylistic cleanup and reorganization.