Refactor and provided a dedicated thread connection.