refactor unittests and peer status vars