Nit: now that these are in the same function we could share the triggerHandler() line by moving it outside the if-else