Refactor nested_attributes in task model