factor out common method into default config