change static if to template overload