refactor, stage 1