Inialisation of classes with attribute