Refactoring of variable manager