Minor cleanup/formatting
General refactoring and renaming for better consistency
Merge branch 'master' into portal_dev