Added database pruning