refactor into nextValue