1.adapter templates,2.optimize the database