Cleanup in GridPanel.h by writing mapping function