Refactor variables handling

introducing Variable objects, all functionality stays the same at this
time