refactor for params type selection from the user