added cleaner code in Trie