Refactor arrow code into something more sequential.