factor out url