make master and slave for v2;TODO: add logging