refactored add_todo into method