replace sender with connection
tutorial: fix typos and refactor