Minor fixes to code structure
Merge pull request #3138 from kevinkirkup/master

Minor fixes to code structure