A method of performing a procedure on an animal using a foam, said foam having a gas composition suitable for performing the procedure; wherein the procedure is performed using a confined space; and wherein the method comprises the steps of - generating foam using a foam generator comprising - an inlet for the gas, - an inlet for an aqueous detergent solution, - a screen comprising a multitude of holes, and - a chamber comprising an outlet for the gas and an outlet for the aqueous detergent solution; - introducing the foam in the confined space, and - covering the animal with the foam; characterized in that the procedure is chosen from i) gas-based stunning, and ii) gas-based euthanizing, the foam generator used for generating the foam comprises - as screen a bubble-forming plate comprising a multitude of through-holes, said through-holes have a first cross-sectional diameter D1 between 1 and 15 mm and a second cross-sectional diameter D2 perpendicular to D1 between 1 and 15 mm, - the ratio of open surface area A h in m 2 of the perforated bubble-forming plate divided by the total surface area of the perforated bubble-forming plate comprising the through-holes is in the range of 0.1 - 0.3, and - the outlet for the aqueous detergent composition comprising a full cone spray nozzle for directly spraying the aqueous detergent composition against the perforated bubble-forming plate; wherein the step of generating the foam comprises - spraying the aqueous detergent composition with a pressure drop over the nozzle of less than 2 Bar directly against the perforated bubble-forming plate at a rate Rd between 0.0003 - 0.0006 m 3 per m 2 of surface area of the perforated bubble-forming plate per second, and - supplying the gas to the perforated bubble-forming plate. - generating foam using a foam generator comprising - an inlet for the gas, - an inlet for an aqueous detergent solution, - a screen comprising a multitude of holes, and - a chamber comprising an outlet for the gas and an outlet for the aqueous detergent solution; - an inlet for the gas, - an inlet for an aqueous detergent solution, - a screen comprising a multitude of holes, and - a chamber comprising an outlet for the gas and an outlet for the aqueous detergent solution; - introducing the foam in the confined space, and - covering the animal with the foam; characterized in that the procedure is chosen from i) gas-based stunning, and ii) gas-based euthanizing, the foam generator used for generating the foam comprises - as screen a bubble-forming plate comprising a multitude of through-holes, said through-holes have a first cross-sectional diameter D1 between 1 and 15 mm and a second cross-sectional diameter D2 perpendicular to D1 between 1 and 15 mm, i) gas-based stunning, and ii) gas-based euthanizing, the foam generator used for generating the foam comprises - as screen a bubble-forming plate comprising a multitude of through-holes, said through-holes have a first cross-sectional diameter D1 between 1 and 15 mm and a second cross-sectional diameter D2 perpendicular to D1 between 1 and 15 mm, - as screen a bubble-forming plate comprising a multitude of through-holes, said through-holes have a first cross-sectional diameter D1 between 1 and 15 mm and a second cross-sectional diameter D2 perpendicular to D1 between 1 and 15 mm, - the ratio of open surface area A h in m 2 of the perforated bubble-forming plate divided by the total surface area of the perforated bubble-forming plate comprising the through-holes is in the range of 0.1 - 0.3, and - the outlet for the aqueous detergent composition comprising a full cone spray nozzle for directly spraying the aqueous detergent composition against the perforated bubble-forming plate; wherein the step of generating the foam comprises - the outlet for the aqueous detergent composition comprising a full cone spray nozzle for directly spraying the aqueous detergent composition against the perforated bubble-forming plate; - spraying the aqueous detergent composition with a pressure drop over the nozzle of less than 2 Bar directly against the perforated bubble-forming plate at a rate Rd between 0.0003 - 0.0006 m 3 per m 2 of surface area of the perforated bubble-forming plate per second, and - supplying the gas to the perforated bubble-forming plate.