better replace dict functionality