Refactor a method into its own class and other cleanup
Add support for scalar and struct parameters