refactors get_row