better type handling