more database/templating stuff