commands are moved to the methods, added writing to a xml file