rewrite bluetooth related code, and remove redundant class files