DB related Jinja files refactoring, fix syntax err #3