move logic into the Workers