Refactor star url generation into helper function.