made tpl more generic