Switch to template @params for sampling functions