moved variables function from C to Base

It will be used in Expression