more trie stuffs
refactored i/o module