Changes after code review

  * replacing 'var' with 'let'
  * deleting extraneous comments
  * replacing local function cleverness with clearer code
  * deleted extra whitespace
  * disabling verbose logging by default