rework types to work with Java API