Fixed membership creation and refactor a lambda