Added classes for type and refactored adding classes