refactor Grid