The parameter validation for all module types follows roughly the same path: first check whether it's a known parameter and then whether the value is valid. This can be moved into common functions that removes duplicated code.