Updated the way state is created