Rename main_window to ui, for consistency with the book