Extract common code into a private helper. Preparation to get line length down to 160 chars. In preparation for #358 on github