Using yaml for config file
Cleaned up WriteToFile