refactor, stage 3