Replacing function newServerWithState with newStateServer and deprecating the former.