Only get the preferences instance when is needed