add Trie and Utils and some refactor