Made generic device configuration function