modify to clean up output template