rework variable usage, real URI without referer, etc