add the low level rebase methods based on SO answer.