Shouldn't we add a method to Preferences class? Specifying the key as a string like this is prone to typos.