Implementing generator/factory for lazy loading proxies