js: refactor user model