Tidied up Connection parse loop