Clean up code to appease jshint