Setup spawn function to create the dynamically loaded objects