Refactored some code

Added Response-reply in communication