write class to data directory