Format codes on saving