refactored relation grid