Removed the global variable usage