Test, refactor and document the connection class