Fixed the order of class definitions