Refactor UserDefinedBuilder#instantiate_class