refactor(connection): externalize state