format and clean up