#5109 Refactor bordered grid