refactoring the kimport command