Factor out loadurl setup