Cleaner way to initialize connection