Refoctaring

Moved algorithm to PegelOnlineAdapter