refactoring user.js - jslint