use Func instead of delegate