separate email monitor logic from other logic