Minor refactoring. Tutorial improvements