Improved pub/sub example

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