refactoring for dynamic parameters, and other updates