Tests and refactoring around process_row