Remove unused lines from YAML file