introduce underscore template to reduce code