bracket match dict for more generalizable code