update db and remove some unneeded stuff