added command manager abstraction to manage the whole communication process