Example: automatic construction of class