Re-worked structure and datatypes