Cleanup of db