added more flexible language handling to user factory