stating to be quite complex… doesn't use custom types anymore