refine of importKnowledgeBase() and writeToFile()