db working. templating