implemented material class using the "library pattern"