Clean up code for JSHint