begin refactor for recent ipython updates