Improved Readability of Material

This is a non-functional change that simply changes the look of the code and adds a macro to help error check and also help clarity.

I verified the non-functionality of this change by code checking and nodes searched.