Sorted classes and applied some changes