printUpdateOutput function refactor