First pass of code cleanup.