Ildipo/notebookmodelaccess

duplicated below in evaluateCode, pls abstract into a function