Move getShift into a separate functionf