Factor out some stair stepping