much better dict handling