refactoring grid in form