cleanup and format