refine dictionary functions