Make get_format() function in addition to detect_format()