refactor, stage 2