Change sort representation to class (do not review yet)

Testing...
This should be moved to an unit test file.