Optimize imports and reformat