Second try to decrease complexity in pico_protocol.c