Variable Engine Improvements

Code refactor and improvments