refactoring: move global variable to local