Code cleanup; added settings section.