Abstract away the row positioning

Equivalent to the mleibman master change of April 20, 2013