Rewriting to make cleaner use of templates, tweaked overloading
Instantiate the necessary template functions