Enhance new function definition for custom objects