upgraded logic of parameter parsing