Some small refactoring, introduced a helper for sending mails and a
UserService object.