changing tag_name and class_name implementation

As per Adam instructions, class variable should be avoided at the
moment, so making a new implementation method based