Refactoring Ian's mangled merge-commit-fix