Code format and sorting