Refactor opening URLs