refactor DB methods