cleanup template code and log4perl config.