Added editing todo functionality. Refactored code.