restructure template to make it more convenient