refactor base prepare phase (wip)