Optimizing the BeanParam instantiation code, thanks to shisholik