Ecofriendly application of foaming agents