added more template functions