switch to using C++11 metafunctions instead of internally implemented