membrane first implementation