Refactored code for ToDo List to use MySQL database instead of flat file