reorganising into a class