Modify formatting logic