You should make your main loop into a simple state machine with two states: (1) initialize, (2) run.
The run starts out with initialize and feeds the important parameters to shift registers on the right. The subsequent iteration mainy use the run state unless a reset is needed.
Search for "state machine" in the example browser and you'll get some ideas. Alternatively, you could post a simplified version of your code here. Good luck.
🙂