use a function to parse params