refactor code, find todo item method and _form.html.erb