i was trying to keep separate flows, but i already did a little refactor and added new parameters so the code is a little bit more cleaner, repeated logic has been removed, after the current issue with the mail templates i will commit the changes to this branch