Factored out boilerplate code in Redis repositories