afms to memberships and refactoring