move set_default and set out of namespace