Split up db and trie and added interface