templatized stuff better