refatory of dealing with the input arguments