add exceptions related to sort
move sort to its own module
use SortFactory