moving if() blocks out of url() statements