Refactoring clear, length, sort and read to use the revised internal storage.