optimizing remove in grid.js