Refactor custom material definitions