Created separate file for device functions