Writing to the DB. Removing old stuff.