Refactored inserting.do_update_line resulting in much simpler functions