refactoring bemicro device,
but not tested