format the codes for storage component, history component and undo component.