Handle device functions better