Device optimizing