Refactoring updating grid