general cleanup and formatting