we can just make the key `format` instead of `pattern`. will reduce the extra case at the bottom.