Improve metrics gathering and remove old template