Remove sorting from fileSystem layer

Use factory method for creating sorting strategy
Close file descriptors properly