Fix: move long code from isr to main loop
cleanup