Fixing ordering issue with classes