made some more progress in the custom type refactor, I think it is
working now...