refactor use 1 db