Improved var and moved to own include file
Refatoring, sharedstate tests