Factor out common code.
Fix it 'til it works.