move template function back to .h to fix compile error