Define main structure and classes