refactor some of the parameter handling into Parameter class