merge the maintemplate.java