Remove Magic number and change the parameters of checkEachTag