stateful <-> stateless loops