how to design a class