add a better wrapping of error/success types.