Some refactoring for the reponsibility methods of client and server