Moved sorting to its own directory