Finish material.cpp cleanup