Toward a better understanding of the templating effect in the formation of porous frameworks: AlPO4-5 a case of study