router experiment I - handle queues with pure functions and loop state