refactored rows method