Replace Abs_Func with Template function