refactor required_with for multiple inputs.