tweak in enforcer, some refactor in the code