attempt at making template.py db indep