refactor db provider init