fix return type
JSHint config
Extract to a function
Fix a few linting issue
Regenerate minified