refactor decide