Import refactoring to make python 2.6 happy