refactor next move