using pub/sub pattern to loose coupling