format and replace