I wouldn't mind moving the assertions into `openAccountPreferences` and removing this function. It would slim down the code a bit