optimizing loading data from YAML and generating indexes in one chunk