moved creation of cluster_name to create_cdg, new factory, added flag to device_variable