fixed duplicated entry in the dict
some clean ups