Reduce the indentation and complexity for AVRCP function