Added ordering field functionality - refactor.