Refactored email signup code