Refactor Monitor et Commander connect/disconnect methods.