worker implementation