Transaction + mail sending + application context refactoring