Implement reporting and refactors connection.