More elegant way of doing enumerations. Changed sorting order