With the advent of regulation, app development has gotten an order of magnitude more complicated. Every time we interact with a user we have to check that we're not violating any agreements (email opt out, cookie opt out, only using their phone number for 2fac, etc) made with that user. In addition, functions that used to apply to all users now have restrictions inside of them, causing them to only apply to certain users.
Take sending an email to a user as an example. In the infancy of your app it may have been ok to email all of your users but as you grew you needed to give users a way to opt out of emails. The simplest approach here is to add a line in the email out code that checks if the user is allowed to receive emails.
function sendEmailTo(user) {
if (!canReceiveEmails(user)) {
return;