refactored addClass and getClasses methods into classes method