implement subscribe and unsubscribe
extend unit tests
improve logging