refactored notebook