Has a row first test and refactored the code