Add sort method to extension
refactor to files.