WIP. Minor code cleanup.