Clean up code structure slightly.