refactored the ordering class