before refactoring
refactoring
refactoring grid
refactoring finding, remove viewDir
refactoring remove duplicate function
refactoring