Bugfix
create_membership factory function
Idiomatic code snippet
Removing duplicated code