Using Procs for the failure function instead of lambdas so that we can have variable arguments