Generalize the template matching
updated styles
updated template