Use public instead of var
Remove globals that are not used