significant rewrite of baseurl section for clarity, props mattr-