Factor out getTurtleOrigin

Small cleanup as part of optimization work.