A system is provided, including a plurality of donor cells and a first alginate structure that encapsulates the plurality of donor cells. The first alginate structure has a guluronic acid concentration of between 64% and 74%. The system additionally includes a second alginate structure that surrounds the first alginate structure, the second alginate structure having a mannuronic acid concentration of between 52% and 60%. A selectively-permeable membrane is coupled at least in part to the second alginate structure. Other embodiments are also described.