refactor default_or_from_file out