Implementing template specialization differently in order to cut out some code.