Some code cleanup and clarification.