upgrade template/callback pattern example