Refatoring AVR BT function