Updated template selection and database