refactorized email form
Fix tests