Refactoring all over to use <type_traits> for implementation of type predicates where possible.