refine redis db to template