major part of rebasing