Allow connections to be built within closure