lots of work on refactoring for offline/tutorial mode