Some minor refactoring

Took generation of e-mail and put it in its own method.
This allow for more usability/extensions.