Cleaned up the logic of TableRow