Refactored the device preferences into a few methods