extracted the cleaning up of rows and columns