move url pieces out of template