Refactor Common#prepare_settings.