refactor stage 1, stage 5, mularcs