restructure RX ISR for enhanced readability of code