Cleanup + removed globals from function arguments