Refactor PcGrid and PcMessage to reduce processing overhead