type handling rework