Move imports into methods and fix docstring typo