encapsulate into publish/subscribe