Change unshared instances to local vars