refactored invalid argument conditional case