Add function to customize native object instantiation