Add class attribute and remove unless variables