Are all of the device functions the same or very similar? If so it might be more efficient to combine them into a single function with the device name as a parameter.