Code cleanup and clarifications.