Reference: move reference adaptation to a separate method

Change-Id: I4a69e65bef4f4cacfe8ce7883e8e1bb627e5db5f