replaced changes in lib with template specialization