Created a cache of materials rather than recreating them everytime