can related parts moved to separate file
USB detect updated for stability