refactor creating todos in todos_controller