[Matahari] [PATCH matahari] Refactored the Host agent.