Prune unnecessary entries
Sort the entries