moved template specializations to namespace scope to make clang/gcc happy