change connection pattern to work with tests