refactor sql provider init