refactoring: delete global variable