some refactoring, make the mempool point to a struct that is the key followed
by the leafentry. Remove the key from the leafentry