Merge shared object init to existing constructor function