better sum type
tidying structure