refactored to different assemblies. added mailservice.