build shared instance for weak singletons