nit that you don't have to change: return nil, err here. It looked like an early success exit and I had to look twice. But that's up for debate as better.