Jim's refactoring, part 1
Merge remote-tracking branch 'origin/master'