code refactor, simplfied trie model, also added cache for dictionary file