added constructor which generates tag based on class