More refactoring/renaming, and a jshint guard