put in piece for stateful code