Refactor some horrifyingly cut-n-pasted code.
Tiny formatting issues.