rework updated and db and remove obsolet code