Move out dict constructor from handler, clean up handler