refactored a bit, added mail