optimize template for function over loading