Clean up code for JsHint