applySourceReference now takes an immutable reference