Rebuild some functions.
The operation of several functions to base on the device status, but I found it's duplicated that I repeat the check at several functions, and that counld be improved.
I reconstruct this module by checking the status before invoking functions, now it's much better.