Minor refactoring in peer code