Some small cleanup and splitting.