clean up writing