Refac: extract worker from app