add default config and support for optional config