updates, refactor DB interface