changed mail implementation again, it was too coupled