refactoring and adding tests for sign up flash errors