added custom template class (final_attrs), fixed #184