Improved pub/sub example

This pull request makes much more easy copy/paste development.