old_contents: require(["UserMedia", "VideoWrapper"], function(UserMedia, VideoWrapper) {
      "use strict";
  
      var startButton = document.getElementById("startButton");
      startButton.onclick = startVideo;
  
      var userMedia = new UserMedia();
  
      function startVideo() {
          startButton.innerHTML = "Stop";
          startButton.onclick = stopVideo;
  
          if (userMedia.hasGetUserMedia()) {
              console.log('Good to go!');
              userMedia.queryCamera();
          } else {
              window.alert('getUserMedia() is not compatible in your browser');
          }
      }
  
      function stopVideo() {
          startButton.innerHTML = "Start";
          startButton.onclick = startVideo;
  
          userMedia.stopMedia();
      }
  });
  
new_contents: require(["UserMedia", "VideoWrapper"], function(UserMedia, VideoWrapper) {
      "use strict";
  
      var startButton = document.getElementById("startButton");
      startButton.onclick = startLocalVideo;
  
      var videoWrapper = new VideoWrapper(document.getElementById('localVideo'));
      var userMedia = new UserMedia(videoWrapper);
  
      function startLocalVideo() {
          startButton.innerHTML = "Stop";
          startButton.onclick = stopLocalVideo;
  
          if (userMedia.hasGetUserMedia()) {
              console.log('Good to go!');
              userMedia.queryCamera();
          } else {
              window.alert('getUserMedia() is not compatible in your browser');
          }
      }
  
      function stopLocalVideo() {
          startButton.innerHTML = "Start";
          startButton.onclick = startLocalVideo;
  
          userMedia.stopMedia();
      }
  });
  
subject: Improve code readability