Minor import changes and refactoring