IoT optimization