Formatting and handle sorting