ModeDemo -> Mode, code cleanup and formatting