Refactoring to make the fix for #2 more DRY.