Move templates out of anonymous namespace into templates namespace