Rework getClasses method again