If you don't use getOrientation() anywhere else, consider just inlining it here.  Or at least move it closer to this function.