rewrite peer manager