3rd variant of using template functions