small js refactoring, read user information to client