Entities sorting, part 1.