Moved global vars into membervare (INTERNAL)