Yi - refactor test code; complete basic function for update