distinguishing gateway and sensor code, and removing the auto configuration to simplify the implementation.