How to simplify a long sequence for remote button press simulation