refactoring and making the import ui niceer