replaced stateful service with state in the model