Moved url generation logic to adapter.