refactor dictionary interface : use contains method