Currently the router function is taking care of all of the command parsing. For code clarity split off the DAC and ADC functionality into separate router functions. The code already parses command syntax such as "XXX:YYYY", e.g. "DAC:WRITE", "ADC:READ".