made some optimization when parsing YAML files