Added the functions as template