REF: moved offset_spines to a separate function