better type matching on inputs