Move URL map/request flag checking stuff to another function