work on variable mask

- extracted methods in a class
- still work todo
- the idea is to modify the variable mask also from knowledge base