Way less globals

Lets see if the commit comments appear here
Yes, ideally it would be like that. But for now I think it works fine line thing. I think we should refactor this later.