Refactoring & Extended support of variables

Subj