Added template for functions