Improved generic wrapper to include objectId