refactored integration layer to peers/masters