Digvijay/Sayali: refactoring connection