merge with dani solution to create via email and also refactoring