Refactor

Refactored to make more readable. Also moved smtp sever to mandrill so that we could use noreply@example.com alias (gmail wouldn't allow it).