clean code and make then JSHint compliant