Foam formation and stability