replace create_state with constructor