I would just `try`/`except` around `get_format` instead of duplicating a lot of its functionality here.  I'm just worried about keeping the logic in sync if it needs to change in the future.