membership and signup refactored code