improved url-templating and logging