Refactoring
Unit test for sorting