Source code refactorings
Pub/sub client implementation.