DB related Jinja files refactoring