Optimizes the code. Adds functionallity to remove the completed todos.