Extract common code from AdapterRunner