refactor, stage 4