Major code refactoring (encapsuling), respective adjustment of notebook