refactor grid view