Code cleanup #7 (almost done).