extracted logic of waiter into own class