Reformat and optimize repository