Refactor celery task class