switch to swap now, since <-> is going away at some point
move the trie stuff to a separate module