Yes. Agreed Jean. Collaboratively, setting ground rules for the class works well.
However a policy could be set: Identify onset of disruptive behaviour and wisely arrest it through get near a pupil, if young, and placing hand on the head, in large class make direct eye contact and call name and say something politely and calmly like, 'Dick. look here, let's continue or listen to this, or let us continue with our activity'; or giving responsibility like distributing books , picking a pen for you, giving more work or more challenging if the child is overactive. Or find out if the cause of disruption by listening to student, even finding out the whether the behaviour has been noticed at home; if so work with care givers to arrest the it.
In case you have to punish,Work should not be used as punishment so as not to give wrong signal. In the same note punishment should not be a reward, for example sending student out when the student just wanted to enjoy basking in the sun. Punishment should be unpleasant but not harmful.