improved template function croaks