split worker logic from bin