Fixing jsHint errors, small refactor code