move templates into db