Moving DB connect to index