A little cleanup of parser and connection code