Rebase functionality

is this stateful?