Update tutorial and refactoring