same functionality for device and function