User email unique database constraint plus test refactoring