created factory for User; no more globalVar