Refactor logic in CompletionsController to Todo