Optimized the DB function save & delete, Optimized the Demo code