Refactor _parseDimensions