major refactoring of parameter handling