Updated AppPreferences to use function prototype for easier integration.