I think the two if cascade could now be combined: `if !( err == nil && engine == nil) { return engine, err }` in all three cases above.