Cleaning up connection.cpp