again you have coupling in code between br2entry and upper contains call. ideally br2entry should be constant map and contains should look into its keys, so there is only one place which you need modify.