cleanly updates db