Refactored shape into rows and cols.